import request from '@/utils/request'

export function getList(query) {
  return request({
    url: '/sysm/role/',
    method: 'get',
    params: query
  })
}

export function getListRole(query) {
  return request({
    url: '/sysm/role/listRole',
    method: 'get',
    params: query
  })
}

export function getroleTypes(query) {
  return request({
    url: '/sysm/role/roleTypes',
    method: 'get',
    params: query
  })
}

export function getListByApp(query) {
  return request({
    url: '/sysm/role/listByApp',
    method: 'get',
    params: query
  })
}

export function getListTree(query) {
  return request({
    url: '/sysm/role/listTree',
    method: 'get',
    params: query
  })
}

export function saveOrUpdate(param) {
  return request.post('/sysm/role/', JSON.stringify(param))
}

export function deleteById(id) {
  return request({
    url: `/sysm/role/${id}`,
    method: 'delete'
  })
}

